package fat
{

import com.fit4as.fit.*;
import com.fit4as.util.io.StringWriter;

public class TextToHtmlFixture extends ColumnFixture {
    public var Text : String;

    public function HTML() : String {
        Text = unescapeAscii(Text);
        return Fixture.escape(Text);
    }

    private function unescapeAscii(text : String) : String {
        text = text.replace(/\\n/g, "\n");
        text = text.replace(/\\r/g, "\r");
        return text;
    }

    private function GenerateOutput(parse : Parse) : String {
        var result : StringWriter = new StringWriter();
        parse.print(result);
        return result.getContent();
    }
}
}